<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript" src="${basePath}js/My97DatePicker/WdatePicker.js"></script>
<#include "/views/ftl/base/manager_include.ftl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>销售单统计</title>
<style>
A{color: #333;}
</style>
<script type="text/javascript">
$(function(){
	$("#search_button").click(function(){
		$('#select_form').submit();
    });
    $('.byTimeOrderTypeBtn').click(function () {
        $('#byTimeOrderType').val($(this).attr('data-value'));
        $('#select_form').submit();
    });


});
</script>
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl">
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "销售单统计_List"></#function>
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>销售单</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>销售单统计</span></a>
      </div>
    </div>

      <!--搜索框-->
        <form action="${basePath}manager/PurchaseSaleOrder_saleOrderStatisticsPage" id="select_form"  method="POST">



			 <div class="input_name">



          	<span style="width:60px;">开始时间:</span>
            <input type="name" name="startTime" readonly="readonly"  id="startTime" value="${(requestVo.startTime)!''}"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text">
    		<span style="width:60px;">结束时间:</span>
    		<input name="endTime" readonly="readonly"  value="${(requestVo.endTime)!''}" id="endTime"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text">

			<a href="javascript:void(0);" id="search_button" class="search_btn" style="  display: inline-block;"><span style="color:white;">搜索</span></a>

                 <input type="hidden" id="byTimeOrderType" name="byTimeOrderType" value="0" />
                 <a href="javascript:void(0);" class="yg-btn yg-btn-success byTimeOrderTypeBtn" data-value="1" style="  display: inline-block;"  >当天</a>
                 <a href="javascript:void(0);" class="yg-btn yg-btn-success byTimeOrderTypeBtn" data-value="2" style="  display: inline-block;"> 昨天 </a>
                 <a href="javascript:void(0);" class="yg-btn yg-btn-success byTimeOrderTypeBtn" data-value="3" style="  display: inline-block;"> 7天 </a>
                 <a href="javascript:void(0);" class="yg-btn yg-btn-success byTimeOrderTypeBtn" data-value="4" style="  display: inline-block;"> 30天 </a>

            </div>
            <#-- <a href="javascript:void(0);" id="search_button" class="search_btn fl" align="center" style="  display: inline-block;"><span >搜索</span></a>  -->
        </form>


       <!-- brandId,goodsNumber,goodsName,goodsCategoryId,totalStockCount,applySex,tagPrice,retailPrice,season,unit,-->
        <div class="clear"></div>
        <!--表格列表-->

        <div class="Table"  style="    display: flex;" >

<#if (orderCategoryStatistics??)>
	<#if ((orderCategoryStatistics?size)>0)>
            <table id="table" class="m_table1" cellpadding="0" cellspacing="1" style="width: 300px;">
                <tbody>
                <tr id="gl">
                    <td style="width: 120px;">订单类型</td>
                    <td style="width: 150px;">总金额</td>
                </tr>

						<#list orderCategoryStatistics as bean>
                        <tr>
                            <td class="orderCategory">
                            <#list  purchaseSaleOrderCategoryTypeEnum as bean2>
                                <#if  bean.orderCategory?? ><#if  bean.orderCategory== bean2.type >${bean2.description} </#if></#if>
                            </#list>

                            </td>
                            <td class="realRetailPrice">${(bean.realRetailPrice?c)!''}</td>

                        </tr>
						</#list>

                </tbody>
            </table>
	</#if>
</#if>

			<#if (payTypeStatistics??)>
				<#if ((payTypeStatistics?size)>0)>

                        <table id="table" class="m_table2" cellpadding="0" cellspacing="1" style="width: 300px;">
                            <tbody>
                            <tr id="gl">
                                <td style="width: 120px;">支付方式</td>
                                <td style="width: 150px;">总金额</td>
                            </tr>

								<#list payTypeStatistics as bean>
                                <tr class="rbody">
                                    <td class="payType">
                                    <#list  payTypeEnum as bean2>
                                        <#if bean.payType?? > <#if bean.payType== bean2.type >${bean2.typeName}</#if> </#if>
                                    </#list>
                                    </td>
                                    <td class="realRetailPrice">${(bean.realRetailPrice?c)!''}</td>
                                </tr>
								</#list>

                            </tbody>
                        </table>



				</#if>
			</#if>



        </div>

  <#--  <div id="main1" style="width: 600px;height:400px;">


    </div>-->





    <!--翻页按钮-->

   <span>数量:</span><span>${(purchaseSaleOrderStatistics.outRealTotalQuantity)?c}件</span>
   <span>总结算:</span> <span>${(purchaseSaleOrderStatistics.realTotalPrice)?c}元</span>
   <span>总生意额：</span>   <span>${(purchaseSaleOrderStatistics.outRealTotalPrice)?c}元</span>


   </div>
   <#-- <script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/3.6.2/echarts.common.min.js"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main1'));


    var orderCategoryStatisticsArray = ${orderCategoryStatisticsJson};

    alert(orderCategoryStatisticsArray);
    $('.m_table1 tbody .rbody').each(function (index, bean) {


        var val1 = $(this).find('.orderCategory').val();
        console.log(val1);

        var val2 = $(this).find('.realRetailPrice').val();
        console.log(val2);

    });

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '订单类型'
        },
        tooltip: {},
        legend: {
            data:['实收']
        },
        xAxis: {
            data: ["衬衫","羊毛衫",]
        },
        yAxis: {},
        series: [{
            name: '销量',
            type: 'bar',
            data: [5, 20, ]
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>-->
</body>
</html>

